#ifndef SERVICEMANAGER_H
#define SERVICEMANAGER_H

#include <QObject>
#include <QDebug>

#include <qbluetoothuuid.h>
#include <qbluetoothserviceinfo.h>
#include <qbluetoothservicediscoveryagent.h>

QTM_USE_NAMESPACE

class ServiceManager : public QObject
{
Q_OBJECT
public:
    ServiceManager();
    ~ServiceManager();

    void startDiscovery();
    void startDiscovery(const QBluetoothUuid &uuid);
    void stopDiscovery();
    QBluetoothServiceInfo service() const;

private:
     QBluetoothServiceDiscoveryAgent *m_discoveryAgent;
     QBluetoothServiceInfo m_service;
     int serviceCount;

private slots:
     void serviceDiscovered(const QBluetoothServiceInfo &serviceInfo);
     void discoveryFinished();

signals:
     void singleServiceInstance();
     void noServiceFound();
};

#endif // SERVICEMANAGER_H
